package model;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class UserDAO {

	// Init ---------------------------------------------------------------------------------------

    private static Map<Long, User> userMap = new LinkedHashMap<Long, User>();

    // Actions ------------------------------------------------------------------------------------

    public User find(Long key) {
        return userMap.get(key);
    }

    public static List<User> list() {
        return new ArrayList<User>(userMap.values());
    }

    public Map<Long, User> map() {
        return userMap;
    }
    
    public static void addUser(User user) {
    	userMap.put(user.getKey(), user);
    }
    
    // Helpers ------------------------------------------------------------------------------------

}
